<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta name="Author" content="benben" />
	<meta name="Description" content="Produces by JWI (http://www.51jsr.com)" />
	<meta name="keywords" content="JavaScript Framework,webUI,js,function,HTML,CSS,脚本" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Jsr内核的封装演示 jsRookie - JavaScript UI module package</title>
	<link rel="shortcut icon" href="/favicon.ico" />
	<link href="../resources/example.css" type="text/css" rel="stylesheet" />
	<script type="text/javascript" src="../jsr/jsr.core.js?loading=true&skin=default&lang=zh-cn"></script>
</head>

<body>
<div id="bodyWrap" class="font">
	<b class="demoCaption">Jsr内核的封装演示</b><hr/><br/>
	<div id="te" style="width:200px;height:100px;background:red;border:1px solid red;position:absolute;left:0px;top:0px">testEvent</div>
	<input type="button" value="addEvent I" onclick="addEvent1()"/>
	<input type="button" value="addEvent II" onclick="addEvent2()"/>
	<input type="button" value="delEvent I" onclick="delEvent1()"/>
	<input type="button" value="delEvent II" onclick="delEvent2()"/>
&copy 2008-2011 51jsr.com
</div>

</body>
<script>
var div = document.getElementById("te"),
fn1 = function(){alert((window.event).type);alert(this.tagName + " + I")},
fn2 = function(){alert(this.tagName + " + II")};



function addEvent1() {
	fn1 = Jsr.addEvent(div, "click", fn1);
}
function addEvent2() {
	fn2 = Jsr.addEvent(div, "click", fn2);
}
function delEvent1(){
	Jsr.removeEvent(div, "click", fn1);
}
function delEvent2(){
	Jsr.removeEvent(div, "click", fn2);
}

//div.onclick = fn1;
/*
var rsFn = Jsr.addEvent(window, "resize", function(){
	var pw = Jsr.getViewportSize();
	div.style.width = pw.width + "px";
	div.style.height = pw.height + "px";
});*/


/*
addEvent
removeEvent
EventDelegate
onload
onresize
*/




var lo = Jsr.EventDelegate(div, "onmousemove",1000);
lo.add("al1", function(){alert(123)})

lo.detach();
</script>
</html> 